<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="utf-8">
    <meta name="author" content="lzy">
    <script src="jquery-3.1.1.js"></script>
    <title>lzy-</title>
    <style>
        textarea{
            width: 500px;
            height: 200px;
        }
    </style>
</head>
<body>
    <div id="titlelen"></div>
    <textarea class="text">11321</textarea>
</body>
</html>
<script>
function len(){

    var value = $('.text').val().length;

    if(value > 80){
    var string = "<span style=\"color:#FF0000\">"+value+"</span>";
    }else{
    var string = "<span>"+value+"</span>";
    }
    $('#titlelen').html(string);
}
len();

$('.text').keyup(function(){
    len();
})
</script>